package com.yyz.zjjcms.model;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsAttributeValue entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cms_ attribute_value", catalog = "zjjcms")
public class CmsAttributeValue implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 2567134588503786545L;
	private String id;
	private CmsAttribute cmsAttribute;
	private CmsTabValue cmsTabValue;
	private String valeurChar;
	private Integer valueInt;
	private String valueText;
	private Date valueDate;
	private Timestamp valueDateTime;
	private String localhost;
	private String url;
	private Integer siz;
	private String name;
	private Integer type1;
	private Integer type2;
	private Set<Choose> chooses = new HashSet<Choose>(0);

	// Constructors

	/** default constructor */
	public CmsAttributeValue() {
	}

	/** minimal constructor */
	public CmsAttributeValue(String id, CmsAttribute cmsAttribute,
			CmsTabValue cmsTabValue) {
		this.id = id;
		this.cmsAttribute = cmsAttribute;
		this.cmsTabValue = cmsTabValue;
	}

	/** full constructor */
	public CmsAttributeValue(String id, CmsAttribute cmsAttribute,
			CmsTabValue cmsTabValue, String valeurChar, Integer valueInt,
			String valueText, Date valueDate, Timestamp valueDateTime,
			String localhost, String url, Integer siz, String name,
			Integer type1, Integer type2, Set<Choose> chooses) {
		this.id = id;
		this.cmsAttribute = cmsAttribute;
		this.cmsTabValue = cmsTabValue;
		this.valeurChar = valeurChar;
		this.valueInt = valueInt;
		this.valueText = valueText;
		this.valueDate = valueDate;
		this.valueDateTime = valueDateTime;
		this.localhost = localhost;
		this.url = url;
		this.siz = siz;
		this.name = name;
		this.type1 = type1;
		this.type2 = type2;
		this.chooses = chooses;
	}

	// Property accessors
	@Id
	@Column(name = "Id", nullable = false, length = 36)
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "cms_attribute_id")
	public CmsAttribute getCmsAttribute() {
		return this.cmsAttribute;
	}

	public void setCmsAttribute(CmsAttribute cmsAttribute) {
		this.cmsAttribute = cmsAttribute;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "cms_tab_value_id")
	public CmsTabValue getCmsTabValue() {
		return this.cmsTabValue;
	}

	public void setCmsTabValue(CmsTabValue cmsTabValue) {
		this.cmsTabValue = cmsTabValue;
	}

	@Column(name = "valeur_char")
	public String getValeurChar() {
		return this.valeurChar;
	}

	public void setValeurChar(String valeurChar) {
		this.valeurChar = valeurChar;
	}

	@Column(name = "value_int")
	public Integer getValueInt() {
		return this.valueInt;
	}

	public void setValueInt(Integer valueInt) {
		this.valueInt = valueInt;
	}

	@Column(name = "value_text", length = 65535)
	public String getValueText() {
		return this.valueText;
	}

	public void setValueText(String valueText) {
		this.valueText = valueText;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "value_date", length = 10)
	public Date getValueDate() {
		return this.valueDate;
	}

	public void setValueDate(Date valueDate) {
		this.valueDate = valueDate;
	}

	@Column(name = "value_date_time", length = 19)
	public Timestamp getValueDateTime() {
		return this.valueDateTime;
	}

	public void setValueDateTime(Timestamp valueDateTime) {
		this.valueDateTime = valueDateTime;
	}

	@Column(name = "localhost")
	public String getLocalhost() {
		return this.localhost;
	}

	public void setLocalhost(String localhost) {
		this.localhost = localhost;
	}

	@Column(name = "url")
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "siz")
	public Integer getSiz() {
		return this.siz;
	}

	public void setSiz(Integer siz) {
		this.siz = siz;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "type1")
	public Integer getType1() {
		return this.type1;
	}

	public void setType1(Integer type1) {
		this.type1 = type1;
	}

	@Column(name = "type2")
	public Integer getType2() {
		return this.type2;
	}

	public void setType2(Integer type2) {
		this.type2 = type2;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cmsAttributeValue")
	public Set<Choose> getChooses() {
		return this.chooses;
	}

	public void setChooses(Set<Choose> chooses) {
		this.chooses = chooses;
	}

}